package cc.minos.components.skins
{
	
	/**
	 * ...
	 * @author Minos
	 */
	public class ArrowIcon extends IconDecorator
	{
		private var commands:Vector.<int>;
		private var data:Vector.<Number>;
		private var _radius:Number = 12;
		
		public function ArrowIcon( skin:Skin , radius:Number = 12 , color:uint = 0xffffff )
		{
			_radius = radius;
			_fillColor = color;
			super( skin );
			_type = "arrowIcon";
		}
		
		override public function draw():void
		{
			super.draw();
			
			commands = Vector.<int>([ 1 ] );
			data = Vector.<Number>([] );
			
			var n:int = 4;
			for ( var i:int = 0 ; i < n ; i++ )
			{
				var angle:Number = Math.PI * 2 / ( n - 1 ) * i
				var nx:Number = Math.cos( angle ) * _radius + startX - _radius / 4;
				var ny:Number = Math.sin( angle ) * _radius + startY;
				if ( i > 0 )
					commands.push( 2 );
				data.push( nx , ny );
			}
			
			icon.graphics.beginFill( fillColor , 1 );
			icon.graphics.drawPath( commands , data );
			icon.graphics.endFill();
			
			trace( "draw arrow" );
		}
	
	}

}